package com.appbee.adminshell.client.gin;


import javax.inject.Singleton;

import com.appbee.adminshell.client.place.AdminPlaceHistoryMapper;
import com.appbee.adminshell.shared.AdminRequestFactory;
import com.appbee.core.client.design.msg.MessageStyleProvider;
import com.appbee.core.client.modular.IModulRegistry;
import com.appbee.core.client.modular.impl.ModulActivityMapper;
import com.appbee.core.client.modular.impl.ModulRegistry;
import com.appbee.core.client.msg.ui.MessageStyle;
import com.appbee.core.client.place.HistorianProvider;
import com.appbee.core.client.place.PlaceControl;
import com.appbee.core.client.place.PlaceHistoryHandlerProvider;
import com.appbee.user.client.gin.WebUserProxyProvider;
import com.appbee.user.shared.proxy.WebUserProxy;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.event.shared.SimpleEventBus;
import com.google.gwt.inject.client.AbstractGinModule;
import com.google.gwt.place.shared.PlaceController;
import com.google.gwt.place.shared.PlaceHistoryHandler;
import com.google.gwt.place.shared.PlaceHistoryMapper;

public class AdminClientModule extends AbstractGinModule {

	@Override
	protected void configure() {	
		bind(MessageStyle.class).toProvider(MessageStyleProvider.class)
				.in(Singleton.class);

		bind(ActivityMapper.class).to(ModulActivityMapper.class);
		bind(IModulRegistry.class).to(ModulRegistry.class).in(Singleton.class);
		bind(EventBus.class).to(SimpleEventBus.class).in(Singleton.class);
		bind(AdminRequestFactory.class).toProvider(
				AdminRequestFactoryProvider.class).in(Singleton.class);
		bind(PlaceControl.class).in(Singleton.class);
		bind(PlaceController.class).to(PlaceControl.class).in(Singleton.class);
		bind(PlaceHistoryHandler.Historian.class).toProvider(
				HistorianProvider.class).in(Singleton.class);
		bind(PlaceHistoryMapper.class).to(AdminPlaceHistoryMapper.class).in(
				Singleton.class);
		bind(PlaceHistoryHandler.class).toProvider(
				PlaceHistoryHandlerProvider.class).in(Singleton.class);

		// Users
		bind(WebUserProxy.class).toProvider(WebUserProxyProvider.class);
		

	}
}